<template>
<div class="bh-result" :class="[typeClass]">
	<div class="bh-result__icon">
		<bh-icon name="circle-check" v-if="icon == 'success'"></bh-icon>
		<bh-icon name="warning-outline" v-else-if="icon == 'warning'"></bh-icon>
		<bh-icon name="info" v-else></bh-icon>
	</div>
	<div class="bh-result__title">{{title}}</div>
	<div class="bh-result__subtitle">{{subTitle}}</div>
	<div class="bh-result__extra">
		<slot name='extra'></slot>
	</div>
</div>
</template>

<script>
export default {
	name: 'bh-result',
	props: {
		subTitle: {
			type: String,
			default: '',
		},
		title: {
			type: String,
			default: '',
		},
		icon: {
			type: String,
			default: 'info',
		},
	},
	data() {
		return {
		}
	},
	methods: {
		close() {
			this.visible = false;
			this.$emit('close');
		},
	},
	computed: {
		typeClass() {
			return `is-${ this.icon }`;
		},
	},
}
</script>
